package com.ssm.opa.common.base.exception;

import com.ssm.opa.common.base.constants.ErrorCode;

/**
 * <p/>
 * Copyright: Copyright (c) 2016/12/6
 * <p/>
 * Company: 途牛科技有限公司华东分公司
 * <p/>
 *
 * @author wanghongqi@tuniu.com
 * @version 1.0.0
 * @project gtb-parent
 */
public class OPAException extends TnException {

	public static final OPAException WRONG_PARAMETER = new OPAException("Wrong parameter", ErrorCode.WRONG_PARAMETER);//请求格式错误
	public static final OPAException METHOD_NOT_SUPPORTED = new OPAException("Method not supported", ErrorCode.METHOD_NOT_SUPPORTED);//方法不支持
	public static final OPAException FORMAT_ERROR = new OPAException("Format error", ErrorCode.FORMAT_ERROR);//入参错误
	public static final OPAException AUTHORITY_ERROR = new OPAException("Authority error", ErrorCode.AUTHORITY_ERROR);//没有权限
	public static final OPAException REDIS_ERROR = new OPAException("Redis error", ErrorCode.REDIS_ERROR);//redis 访问异常
	public static final OPAException MESSAGE_EXCEPTION = new OPAException("Message exception", ErrorCode.MESSAGE_EXCEPTION);//报文不一致
	public static final OPAException NO_LOGIN_INFO = new OPAException("No login info", ErrorCode.NO_LOGIN_INFO);//没有登录信息
	public static final OPAException KEY_MISS_EXCEPTION = new OPAException("Key miss exception", ErrorCode.KEY_MISS_EXCEPTION);//密钥缺失
	public static final OPAException RESOURCE_NOT_FOUND = new OPAException("Resource not found", ErrorCode.RESOURCE_NOT_FOUND);//未查询到资源

	public OPAException(int errorCode) {
		super(errorCode);
	}

	public OPAException(String message, int errorCode) {
		super(message, errorCode);
	}

	public OPAException(String message, Throwable cause, int errorCode) {
		super(message, cause, errorCode);
	}

	public OPAException(Throwable cause, int errorCode) {
		super(cause, errorCode);
	}

	public OPAException(TnException tnException) {
		super(tnException);
	}

	public OPAException(TnException tnException, String message) {
		super(tnException, message);
	}

	public OPAException(TnException tnException, Throwable e) {
		super(tnException, e);
	}

	public OPAException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int errorCode) {
		super(message, cause, enableSuppression, writableStackTrace, errorCode);
	}
}
